﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.IO;
namespace ToaThuoc_PAK.Handler
{
    /// <summary>
    /// Summary description for jQueryHandler
    /// </summary>
    public class jQueryHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            using (Page page = new Page())
            {
                page.Controls.Add(LoadControl(context));                                
                using (StringWriter writer = new StringWriter())
                {
                    context.Server.Execute(page, writer, false);
                }
            }
        }

        private Control LoadControl(HttpContext context)
        {
            string path = context.Request.Url.LocalPath;
            UserControl userControl = null;
            using (Page page = new Page())
            {
                userControl = page.LoadControl("/UserControls/ChiDinh.ascx") as UserControl;
            }
            return userControl;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}